package com.aaa.day1106.day110603;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author ${崔灿}
 * @date 2022/11/06 18:42
 **/

public class Test04 {
    public static void main(String[] args) {
        Date date = new Date(2002,66,1);
        //System.out.println(date);

        //时间格式转化，存在线程安全问题
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        //System.out.println(sdf.format(date));
        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        System.out.println(sdf.parse("2010-1-9"));
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                }
            }).start();
        }
    }
}
